﻿using System;

namespace TfsUtils.Ui.Mvvm.Command
{
	public interface IMonitor
	{
		/// <summary>
		/// Occurs when the source monitored by this monitor changes.
		/// </summary>
		event EventHandler Changed;

		/// <summary>
		/// Asks this monitor to raise a change notification in order 
		/// to trigger all the listeners.
		/// </summary>
		void NotifyChanged();

		/// <summary>
		/// Stops all the monitoring operation.
		/// </summary>
		void StopMonitoring();
	}

	public interface IMonitor<T> : IMonitor
	{
		/// <summary>
		/// Gets the monitored source.
		/// </summary>
		/// <value>The monitored source.</value>
		T Source { get; }
	}
}
